home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Peter Lewis / Morpion 1.0.0 / source / PNL Libraries / MySystemGlobals.unit < prev    next >
Encoding:
Text File  |  1993-11-21  |  1.4 KB  |  45 lines  |  [TEXT/PJMM]

  1. unit MySystemGlobals;
  2.  
  3. interface
  4.  
  5.     var  { set up by InitSystemGlobals }
  6.         system7: boolean;
  7.         has_appleEvents: boolean;
  8.         has_findfolder: boolean;
  9.         has_aliasMgr: boolean;
  10.         has_newStdFile: boolean;
  11.         has_HelpMgr: boolean;
  12.         has_colorQD: boolean;
  13.         app_resfile: integer;
  14.         app_fs: FSSpec;
  15.  
  16.     procedure InitSystemGlobals;
  17.  
  18. implementation
  19.  
  20. {$S Init}
  21.     procedure InitSystemGlobals;
  22.         var
  23.             oe: OSErr;
  24.             gv: longInt;
  25.             pb: FCBPBRec;
  26.             sysenv: sysEnvRec;
  27.     begin
  28.         app_resfile := CurResFile;
  29.         pb.ioNamePtr := @app_fs.name;
  30.         pb.ioVRefNum := 0;
  31.         pb.ioRefNum := app_resfile;
  32.         pb.ioFCBIndx := 0;
  33.         oe := PBGetFCBInfo(@pb, false);
  34.         app_fs.vRefNum := pb.ioFCBVRefNum;
  35.         app_fs.parID := pb.ioFCBParID;
  36.         has_colorqd := (SysEnvirons(1, sysEnv) = noErr) & sysenv.hasColorQD; { Gestalt has a bug that causes hasColourQD to always be set }
  37.         system7 := (Gestalt(gestaltSystemVersion, gv) = noErr) & (gv >= $0700);
  38.         has_AppleEvents := (Gestalt(gestaltAppleEventsAttr, gv) = noErr) & (BTST(gv, gestaltAppleEventsPresent));
  39.         has_findfolder := (Gestalt(gestaltFindFolderAttr, gv) = noErr) & (BTST(gv, gestaltFindFolderPresent));
  40.         has_newStdFile := (Gestalt(gestaltStandardFileAttr, gv) = noErr) & (BTST(gv, gestaltStandardFile58));
  41.         has_HelpMgr := (Gestalt(gestaltHelpMgrAttr, gv) = noErr) & (BTST(gv, gestaltHelpMgrPresent));
  42.         has_aliasMgr := (Gestalt(gestaltAliasMgrAttr, gv) = noErr) & (BTST(gv, gestaltAliasMgrPresent));
  43.     end;
  44.  
  45. end.